import { request } from '../request';

/* 注销用户 */
export function settingCancelUser() {
  return request<boolean>({
    url: '/setting/cancel-user',
    method: 'get',
  });
}

/* 修改密码 */
export function settingChangePasswd(params: {
  oldPasswd: string;
  newPasswd: string;
  newPasswd2: string;
}) {
  return request<boolean>({
    url: '/setting/change-passwd',
    method: 'post',
    data: params,
  });
}

/* 用户信息更改 */
export function settingChangeUser(params: {
  username: string;
  age: number;
  avatar: string;
  summary: string;
  homeLink: string;
}) {
  return request<boolean>({
    url: '/setting/change-user',
    method: 'post',
    data: params,
  });
}

/* 用户头像更改 */
export function settingChangeAvatar(params: { avatar: string }) {
  return request<boolean>({
    url: '/setting/change-avatar',
    method: 'post',
    data: params,
  });
}

/* 设置密码 */
export function settingSetPasswd(params: {
  newPasswd: string;
  newPasswd2: string;
}) {
  return request<boolean>({
    url: '/setting/set-passwd',
    method: 'post',
    data: params,
  });
}
